package com.qf.controller;

import com.qf.entity.TbJudgeQuestion;
import com.qf.service.JudgeQuestionService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 判断题添加
 */
@RestController
@RequestMapping("/judge")
public class JudgeQuestionController {


    @Autowired
    JudgeQuestionService judgeQuestionService;

    @PostMapping("/addJudge")
    public ResultMsg addJudge(@RequestBody TbJudgeQuestion tbJudgeQuestion){
        return judgeQuestionService.addJudgeQuestion(tbJudgeQuestion);
    }

    /**
     * 查询最后一条记录,返回题目id
     * @return
     */
    @GetMapping("/findJudgeById")
    public ResultMsg selectChoiceById(){
        return judgeQuestionService.selsctJudgeOne();
    }
}
